using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Habanero.Base;
using Habanero.BO;
using Habanero.Faces.Base;
using Habanero.Faces.Win;
using DockStyle=Habanero.Faces.Base.DockStyle;

namespace FireStarterModeller.UI
{
    public class TestFormControl<TBusinessObject> : UserControlWin, IFormControl
        where TBusinessObject : class, IBusinessObject, new()
    {
        public TestFormControl(IControlFactory controlFactory, IBOEditorControl childControl, BusinessObjectCollection<TBusinessObject> collection)
        {

            BOGridAndEditorControlWin<TBusinessObject> gridAndBOEditorControl =
                new BOGridAndEditorControlWin<TBusinessObject>(controlFactory, childControl);
            //if (relationship == null)
            //{
            //    gridAndBOEditorControl.BusinessObjectCollection = new BusinessObjectCollection<TBusinessObject>());
            //}
            //else
            //{
            //    DMProject projectInfo = new DMProject();
            //    gridAndBOEditorControl.BusinessObjectCollection = projectInfo.BusinessObjects);

            //}
            gridAndBOEditorControl.BusinessObjectCollection = collection;
           
            //GridAndBOEditorControl<DMAssembly> gridAndBOEditorControl =
            //    new GridAndBOEditorControl<DMAssembly>(controlFactory, new ProjectAssemblyInfoControl(controlFactory));
            //gridAndBOEditorControl.BusinessObjectCollection = new BusinessObjectCollection<DMAssembly>());

            IControlHabanero control = gridAndBOEditorControl;

            //classInfoControl.DetailPanelInfo = new DMClass();
            //ClassSelectorControl assemblyControl = new ClassSelectorControl();
            //IControlHabanero control = assemblyControl;
            control.Dock = DockStyle.Fill;
            this.Controls.Add((Control) control);
        }


        public void SetForm(IFormHabanero form)
        {
            
        }
    }
}
